package com.sk.sourcecircle.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.sourcecircle.R;
import com.sk.sourcecircle.entity.NoticeDetailsInfo;
import com.sk.sourcecircle.utils.MyUtils;

import java.util.List;

/**
 * Created by sk on 2018/1/2.
 */

public class SimalConsultAdapter extends BaseQuickAdapter<NoticeDetailsInfo.DataBean.SimilarListBean, BaseViewHolder> {

    public SimalConsultAdapter(int layoutResId, @Nullable List<NoticeDetailsInfo.DataBean.SimilarListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NoticeDetailsInfo.DataBean.SimilarListBean item) {
        String tvTime = MyUtils.getTimeFormatText(item.getCreate_time());
        helper.setText(R.id.tv_title, item.getTitle())
                .setText(R.id.tv_info, tvTime + "   " + item.getShow() + "人看   " + item.getComment() + "评论");
        Glide.with(mContext).load(item.getHead_url()).into((ImageView) helper.getView(R.id.item_bg));
    }
}
